package com.opennews.openplatform.familyexpenseapi.controller

import com.opennews.openplatform.familyexpenseapi.service.RoleService
import com.opennews.openplatform.myspringbootcore.dto.ApiResponse
import com.opennews.openplatform.myspringbootcore.util.getSuccessResponse
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/role")
class RoleController(
    private val roleService: RoleService,
) {
    @GetMapping("/query-non-system-level-roles")
    fun queryNonSystemLevelRoles(): ResponseEntity<ApiResponse<List<Map<String, Any>>>> {
        val result = roleService.queryNonSystemLevelRoles()
        return getSuccessResponse(result)
    }

    @GetMapping("/query-all-roles")
    fun queryAllRoles(): ResponseEntity<ApiResponse<List<Map<String, Any>>>> {
        val result = roleService.queryAllRoles()
        return getSuccessResponse(result)
    }
}